(function() {
	require(['jquery', 'vbox', 'select2'], function(jquery, vbox) {
		
		if(typeof jQuery === 'undefined') {	//检测jquery依赖项
			throw new Error('jquery依赖项未能加载');
		}
		
		if(typeof $.fn.bootstrapValidator === 'undefined') {	//检测bootstrapValidator依赖项
			throw new Error('bootstrapValidator依赖项未能加载');
		}
		
		var formData = [{id:"0", text:"省局"}, {id:"1", text:"司局"}, {id:"9", text:"其他"}];
		$("#create_noticeObject").select2({
			 placeholder: "公告对象",
			 allowClear: true,
			 data: formData,
			 multiple: true,
			 minimumResultsForSearch: Infinity
		 }).val("test_change_type").trigger("change");
		
		//验证添加
		var v = vbox;
		$('#notice_create_form').bootstrapValidator({
	        feedbackIcons:v.feedbackIcons,
	        trigger: 'blur',
	        fields: {
	        	noticeName: {
	                validators: {
	                    notEmpty:v.notEmpty
	                }
	            },
	            noticeObject: {
	                validators: {
	                    notEmpty:v.notEmpty
	                }
	            },
	            content: {
	                validators: {
	                    notEmpty:v.notEmpty
	                }
	            }
	        }
	    });
		
	});
})();